package com.sise.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sise.entity.Rating;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zj
 */
public interface RatingMapper extends BaseMapper<Rating> {

    @Select("select user,item,item_rating,item_value from rating where user=#{user} and item=#{item}")
    Rating getRatingByUserAndItem(Rating rating);

    @Select("select user,item,item_rating,item_value from rating where user=#{user} and item_value not in(0) order By item_value Desc")
    List<Rating> getRatingByUserOrderByDescNotIn0(Rating rating);

}
